const goodReducer = (
  state = {
    name: '薯片',
    time: 24,
  },
  action
) => {
  if (action.type === 'goods/setGoodName') {
    return {
      ...state,
      name: action.payload,
    }
  }

  if (action.type === 'goods/setGoodTime') {
    return {
      ...state,
      time: action.payload,
    }
  }
  return state
}

export default goodReducer
